var arr = [1,2,3,4]
console.log(arr.map(n=>n*n))
//[ 1, 4, 9, 16 ]

var a = [1,3,-5,0]
console.log(arr.map(n => n<0))
//[ false, false, false, false ]

var users = [
    {name:'aaa',email:'a@a.com'},
    {name:'bbb',email:'b@b.com'},
    {name:'ccc',email:'c@c.cc'}
]
//获取所有人的email
var emails = users.map(n => n.email)
console.log(emails)
//[ 'a@a.com', 'b@b.com', 'c@c.cc' ]

//获取指定人的email
var email = emails.filter(n => /^a/.test(n))
console.log(email)
//[ 'a@a.com' ]

var email2 = emails.find(n => /^a/.test(n))
console.log(email2)
//a@a.com

console.log([1,-2,3,-5,-7,0].filter(n=>n<0))
//[ -2, -5, -7 ]
console.log([1,-2,3,-5,-7,0].find(n=>n<0))
//-2